package com.theydream.qeechain.loading;



import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.theydream.qeechain.R;
import com.theydream.qeechain.main.ActiveMenu;
import com.theydream.qeechain.main.BossPage;

/**
 * Loading Toy2R Logo
 *
 */
public class StartingScreen2R extends Activity{
	
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.starting_screen2r);
		ImageView mImage=(ImageView) findViewById(R.id.image_toy2r);
		Animation animation = AnimationUtils.loadAnimation(this, R.anim.anim_starting_screen);
		mImage.startAnimation(animation);
		animation.setAnimationListener(new Animation.AnimationListener() {
			public void onAnimationEnd(Animation animation) {
			String PREF_NAME= "IsFirstGame";
			SharedPreferences prefSetting=getSharedPreferences(PREF_NAME,MODE_PRIVATE);
			if (prefSetting.getBoolean("FirstGame", true))
			{
				startActivity(new Intent(StartingScreen2R.this,BossPage.class));
			}
			else
			{
				startActivity(new Intent(StartingScreen2R.this,ActiveMenu.class));
//				startActivity(new Intent(StartingScreen2R.this,HomeMenuScreen.class));
			}
	
			StartingScreen2R.this.finish();
			}

			public void onAnimationRepeat(Animation animation) {

			}

			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
				
			}
	});
	}
	
	

}
